package com.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.ShoukeanpaiDao;
import com.entity.ShoukeanpaiEntity;
import com.entity.view.ShoukeanpaiView;
import com.entity.vo.ShoukeanpaiVO;
import com.service.ShoukeanpaiService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("shoukeanpaiService")
public class ShoukeanpaiServiceImpl extends ServiceImpl<ShoukeanpaiDao, ShoukeanpaiEntity> implements ShoukeanpaiService {
	
	
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<ShoukeanpaiEntity> page = this.selectPage(
                new Query<ShoukeanpaiEntity>(params).getPage(),
                new EntityWrapper<ShoukeanpaiEntity>()
        );
        return new PageUtils(page);
    }
    
    @Override
	public PageUtils queryPage(String tableName,Map<String, Object> params, Wrapper<ShoukeanpaiEntity> wrapper) {
		  Page<ShoukeanpaiView> page =new Query<ShoukeanpaiView>(params).getPage();
	        page.setRecords(baseMapper.selectListView(tableName,page,wrapper));
	    	PageUtils pageUtil = new PageUtils(page);
	    	return pageUtil;
 	}
    
    @Override
	public List<ShoukeanpaiVO> selectListVO(Wrapper<ShoukeanpaiEntity> wrapper) {
 		return baseMapper.selectListVO(wrapper);
	}
	
	@Override
	public ShoukeanpaiVO selectVO(Wrapper<ShoukeanpaiEntity> wrapper) {
 		return baseMapper.selectVO(wrapper);
	}
	
	@Override
	public List<ShoukeanpaiView> selectListView(Wrapper<ShoukeanpaiEntity> wrapper) {
		return baseMapper.selectListView(null,wrapper);
	}

	@Override
	public ShoukeanpaiView selectView(Wrapper<ShoukeanpaiEntity> wrapper) {
		return baseMapper.selectView(wrapper);
	}


}
